import {
  // 显示loding提示框
  SHOWLOADING,
  // 隐藏loding提示框
  HIDELOADING,
  // ajax请求数量
  AJAXCOUNT,
  // 倒计时时间
  TIMES
} from './type.js'

const state = {
    // loding提示框
    'showLoading': false,
    // ajax请求数量
    'ajaxCount': 0,
    // 倒计时时间
    'times': 0
  },
  mutations = {
    // 显示loding提示框
    [SHOWLOADING]: (state) => state.showLoading = true,
    // 隐藏loding提示框
    [HIDELOADING]: (state) => state.showLoading = false,
    // ajax请求数量
    [AJAXCOUNT]: (state, index) => state.ajaxCount = index,
    // 倒计时时间
    [TIMES]: (state, index) => state.times = index
  },
  getters = {
    // loding提示框
    'showLoading': (state) => state.showLoading,
    // ajax请求数量
    'ajaxCount': (state) => state.ajaxCount,
    // 倒计时时间
    'times': (state) => state.times
  }

export default {
  state,
  mutations,
  getters
}
